var twoD = {
    name:"2D shape",
    dimensions:2
};
function triangle(s,h){
    var that = Object(twoD);
    that.name = 'Triangle';
    that.getArea = function(){
        return this.side * this.height / 2 ;
    };
    that.side=s;
    that.height=h;
    return that;
}
var t = triangle(5,10);
console.log("var t = triangle(5,10)");
console.log("t.dimensions");
console.log(t.dimensions);
var t2= new triangle(5,5);
console.log("var t2= new triangle(5,5)");
console.log("t2.getArea()");
console.log(t2.getArea());